<?php
/**
 * Created by PhpStorm.
 * User: s.utkin
 * Date: 18.05.2015
 * Time: 14:56
 */

namespace Jobs\Sitemap;


use Messenger\Messages;
use Pinenut\CombinationIterator;
use SitemapGenerator\DataProvider\ModelFieldProvider;

class TestAction extends \Action {

	protected function run()
	{
		$this->response->noRender(true);
		$this->response->noCache(true);

		$gen = new ModelFieldProvider(
			[
				'model' => '\Users\Profile',
				'field' => 'nickname',
				'condition'
			]
		);

		foreach ($gen as $key =>$item) {
			echo "$key -> $item\n";
		}

//		$iterator1 = new \ArrayIterator([1, 2, 3, 4]);
//		$iterator2 = new \ArrayIterator(['a', 'b', 'c', 'd']);
//
//		$multiple = new CombinationIterator();
//		$multiple->addIterator($iterator1, 'first');
//		$multiple->addIterator($iterator2, 'second');
//
//		foreach ($multiple as $value) {
//			var_dump($value);ob_flush();
//		}
	}
}
